package cn.ultrarisk.scadmin.manager.web.controller;

import cn.ultrarisk.scadmin.manager.biz.user.dao.AdminDAO;
import cn.ultrarisk.scadmin.manager.biz.user.util.SessionUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * LoginController
 *
 * @author sevendlong(lin23871@163.com)
 * @date 2014/4/17
 * @since V1.0
 */
@Controller
@RequestMapping("/logout")
public class LogoutController extends BaseController {
    @Autowired
    private AdminDAO adminDAO;

    @ResponseBody
    @RequestMapping(value = "", method = RequestMethod.GET)
    public ResponseEntity<Boolean> logout() {
        SessionUtil.setAdmin(null);
        return getOkResponseEntity(true);
    }
}
